package org.example.cloudapply.controller;

import lombok.RequiredArgsConstructor;
import org.example.cloudapply.entity.Result;
import org.example.cloudapply.service.CloudStatsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin/stats")
@RequiredArgsConstructor
public class CloudStatsController {
    private final CloudStatsService cloudStatsService;

    @GetMapping("/openstack")
    public Result<Map<String, Integer>> getOpenStackStats() {
        return Result.success(cloudStatsService.getOpenStackStats());
    }

    @GetMapping("/yunhong")
    public Result<Map<String, Integer>> getYunhongStats() {
        return Result.success(cloudStatsService.getYunhongStats());
    }
}